package com.xingongchang.baolebei.protocol;

import org.json.JSONException;
import org.json.JSONObject;

import android.R.integer;

import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;
import com.insthub.BeeFramework.model.BaseModel;

@Table(name = "Goos_item")
public class Goos_item extends BaseModel{
	@Column(name = "goods_id")
	public int goods_id;
	
	@Column(name = "goods_name")
	public String goods_name;
	
	@Column(name = "goods_thumb")
	public String goods_thumb;
	
	@Column(name = "short_name")
	public String short_name;
	
	@Column(name = "goods_img")
	public String goods_img;
	
	@Column(name = "shop_price")
	public String shop_price;
	
	public static Goos_item fromJson(JSONObject jsonObject)
			throws JSONException {
		if (null == jsonObject) {
			return null;
		}

		Goos_item localItem = new Goos_item();

		localItem.goods_thumb = jsonObject.optString("goods_thumb");

		localItem.shop_price = jsonObject.optString("shop_price");

		localItem.goods_name = jsonObject.optString("goods_name");

		localItem.goods_id = jsonObject.optInt("goods_id");
		
		localItem.short_name = jsonObject.optString("short_name");
		
		localItem.goods_img = jsonObject.optString("goods_img");
		return localItem;
	}
	
	
}
